package mr.ali.videoapp;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Administrator
 */
@SpringBootApplication
@EnableScheduling
@MapperScan("mr.ali.videoapp.portal.mapper") // 扫描Mapper接口所在的包
public class VideoAppApplication {

   public static void main(String[] args) {
      SpringApplication.run(VideoAppApplication.class, args);
   }

   /**
    * 判断字符是否为汉字
    *
    * @param ch 需要判断的字符
    * @return 如果是汉字返回 true，否则返回 false
    */
   public static boolean isChineseCharacter(char ch) {
      // Unicode 编码范围
      return (ch >= 0x4E00 && ch <= 0x9FFF) ||
            (ch >= 0x3400 && ch <= 0x4DBF) ||
            (ch >= 0x20000 && ch <= 0x2A6DF) ||
            (ch >= 0x2A700 && ch <= 0x2B73F) ||
            (ch >= 0x2B740 && ch <= 0x2B81F) ||
            (ch >= 0x2B820 && ch <= 0x2CEAF) ||
            (ch >= 0x2CEB0 && ch <= 0x2EBEF) ||
            (ch >= 0xF900 && ch <= 0xFAFF);
   }

}
